#include "Threadpool.hpp"
#include "Task.hpp"
#include <memory>

using namespace ThreadPoolModule;

int main()
{
    ENABLE_CONSOLE_LOG();
    //ENABLE_FILE_LOG();

    std::unique_ptr<ThreadPool<task_t>> tp = std::make_unique<ThreadPool<task_t>>();
    tp->Start();

    int cnt = 10;
    while (cnt--)
    {
        tp->Equeue([](string name)
                   { LOG(LogLevel::DEBUG) << "I am " << name << ", I am running"; });

        sleep(1);
    }

    tp->Stop();
    tp->Wait();

    return 0;
}
